package nd.android.am.test;

import static com.googlecode.autoandroid.positron.PositronAPI.Key.DOWN;
import nd.android.am.AccountList;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.googlecode.autoandroid.positron.junit4.TestCase;


public class AccountTestCase extends TestCase {

	@Before
	public void setUp() {
//		sql(AccountProvider.DATABASE_NAME, "DELETE FROM accounts");
		startActivity("nd.android.am", "nd.android.am.AccountList");
		pause();
	}
	
	@Test
	public void testAddAccount() {
		menu(AccountList.MENU_ITEM_INSERT);
		press("2009-03-17", DOWN, "Hello", DOWN, "159", DOWN);
		set("#payer_edit.text", "我");
		set("object", "2", int.class.getName());
		set("object", "1", Integer.class.getName());
		set("charSequence", "hello charsequence");
		set("string", "hello string");
		System.out.println(invoke("invokeObject"));
		sendString("i");
		press(DOWN);
		sendString("i,u");
		press(DOWN);
		sendString("well");
		press(DOWN);
		touch("#purpose_edit");
		touch("#desc_edit");
		System.out.println(stringAt("title"));
		System.out.println(stringAt(1, "title"));
		touch("#save");
//		click();
	}
	
	@After
	public void tearDown2() {
		System.out.println("tearDown");
	}
}
